package com.yunrui.device.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunrui.device.entity.Cabinet;
import com.yunrui.device.vo.CabinetVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CabinetMapper extends BaseMapper<Cabinet> {
    
    @Select("SELECT c.*, t.type_name AS typeName " +
            "FROM cabinet c " +
            "LEFT JOIN cabinet_type t ON c.type_id = t.id")
    List<CabinetVO> selectWithTypeName();
}